/**
 * 
 */
package cn.antia.cwin.window;

import java.util.*;

import cn.antia.cwin.SysConf;
import cn.antia.cwin.Cele;
import cn.antia.cep.busi.BusiException;

/**
 * @author sunkeei
 * @date Dec 29, 2007
 * @time 9:30:03 PM
 */
public class WindowOneManyService extends WindowService {

	public void delete(String winId, int id,Map<Cele,Object> otherElements) throws BusiException {
		super.delete(winId, id, otherElements);
		MultiWindow multiWindow = getAntiaPoolHelper().getMultiWindow(winId);
		SingleWindow priWindow = getAntiaPoolHelper().getSingleWindowNoClone(multiWindow.getPrimary());
		SingleWindow secWindow = getAntiaPoolHelper().getSingleWindowNoClone(multiWindow.getSecondary());
		String foreignKey = "";
		HashMap relations = multiWindow.getRelations();
		foreignKey = (String)relations.get(SysConf.KEY_FIELD);
		getDbService().delete(priWindow.getTable(), id, secWindow.getTable(), foreignKey);
	}

	public void delete(String winId, Map<Cele,Object> conditions,Map<Cele,Object> otherElements) throws BusiException {
		super.delete(winId, conditions, otherElements);
	}
	
}
